/*-----------------------------------------------------------------------------
	The contents of this file are subject to the Mozilla Public License
	Version 1.1 (the "License"); you may not use this file except in
	compliance with the License. You may obtain a copy of the License at
	http://www.mozilla.org/MPL/
	
	Software distributed under the License is distributed on an "AS IS"
	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
	License for the specific language governing rights and limitations
	under the License.
	
	The Original Code is Fever Framework code.
	
	The Initial Developer of the Original Code is Romain Ecarnot.
	Portions created by Initial Developer are Copyright (C) 2006
	the Initial Developer. All Rights Reserved.
	
	Contributor(s):
	
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
-----------------------------------------------------------------------------*/

import fever.app.local.LocalisationEvent;
import fever.core.Resources;

/**
 * Localisation properties for {@link fvaswing.components.reader.abstract.FvReader} 
 * component.
 * 
 * @author Romain Ecarnot
 */
class fvaswing.components.reader.FvReaderResources extends Resources
{
	//-------------------------------------------------------------------------
	// Private properties
	//-------------------------------------------------------------------------
	
	private static var _instance : FvReaderResources;
	
	
	//-------------------------------------------------------------------------
	// Public Properties
	//-------------------------------------------------------------------------
	
	public var readerTitle : String;
	public var closeLabel : String;
	public var popupLabel : String;
	public var embdedLabel : String;
	public var maximizeLabel : String;
	public var minimizeLabel : String;
	
	public var loadingLabel : String;
	public var loadingError : String;
	
	public var fileMenuLabel : String;
	public var openFileLabel : String;
	public var openListLabel : String;	public var showListLabel : String;
	public var saveListLabel : String;	public var clearListLabel : String;
	public var docMenuLabel : String;
	
	public var listTitle : String;
	public var titleLabel : String;
	public var urlLabel : String;
	public var docFolderLabel : String;
	public var extFolderLabel : String;
	
	public var alertTitle : String;
	public var alertAlreadyInUse : String;
	public var alertError : String;	public var alertList : String;
	
	// FlashPaper reader
	public var paperTitle : String;
	public var paperPage : String;
	public var paperPrint : String;
	public var paperPrevious : String;
	public var paperNext : String;
	public var paperFitPage : String;
	public var paperFitWidth : String;
	public var paperZoomPlus : String;
	public var paperZoomMinus : String;
	public var paperOpenBrowser : String;
	
	// Video player
	public var videoTitle : String;
	public var videoSize : String;
	public var videoDuration : String;
	public var videoPlay : String;
	public var videoStop : String;
	public var videoFull : String;
	public var videoFullErrorTitle : String;	public var videoFullErrorMessage : String;
	public var videoVolume : String;	public var videoIncrease : String;	public var videoDecrease : String;	public var videoMute : String;
	
	
	//-------------------------------------------------------------------------
	// Public API
	//-------------------------------------------------------------------------
	
	/**
	 * Returns {@link FvReaderResources} instance.
	 * 
	 * <p>Singleton design
	 */
	public static function getInstance() : FvReaderResources
	{
		if( !_instance ) _instance = new FvReaderResources();
		return _instance;
	}
	
	/** 
	 * Triggered when Localisation language change.
	 */
	public function onLocalisationUpdate( event : LocalisationEvent ) : Void
	{
		readerTitle = getTranslation( 'readerTitle' );
		closeLabel = getTranslation( 'closeLabel' );
		popupLabel = getTranslation( 'popupLabel' );
		embdedLabel = getTranslation( 'embdedLabel' );
		maximizeLabel = getTranslation( 'maximizeLabel' );
		minimizeLabel = getTranslation( 'minimizeLabel' );
		
		loadingLabel = getTranslation( 'loadingLabel' );
		loadingError = getTranslation( 'loadingError' );
		
		fileMenuLabel = getTranslation( 'fileMenuLabel' );
		openFileLabel = getTranslation( 'openFileLabel' );
		openListLabel = getTranslation( 'openListLabel' );
		showListLabel = getTranslation( 'showListLabel' );
		saveListLabel = getTranslation( 'saveListLabel' );
		clearListLabel = getTranslation( 'clearListLabel' );
		docMenuLabel = getTranslation( 'docMenuLabel' );
		
		alertTitle = getTranslation( 'alertTitle' );
		alertAlreadyInUse = getTranslation( 'alertAlreadyInUse' );
		alertError = getTranslation( 'alertError' );
		alertList = getTranslation( 'alertList' );
		
		// playlist
		docFolderLabel = getTranslation( 'docFolderLabel' );
		extFolderLabel = getTranslation( 'extFolderLabel' );
		
		listTitle = getTranslation( 'listTitle' );
		titleLabel = getTranslation( 'titleLabel' );
		urlLabel = getTranslation( 'urlLabel' );
		
		// FlashPaper 
		paperTitle = getTranslation( 'paper.title' );
		paperPage = getTranslation( 'paper.page' );
		paperPrint = getTranslation( 'paper.print' );
		paperPrevious = getTranslation( 'paper.previous' );
		paperNext = getTranslation( 'paper.next' );
		paperFitPage = getTranslation( 'paper.fitPage' );
		paperFitWidth = getTranslation( 'paper.fitWidth' );
		paperZoomPlus = getTranslation( 'paper.zoomPlus' );
		paperZoomMinus = getTranslation( 'paper.zoomMinus' );
		paperOpenBrowser = getTranslation( 'paper.openBrowser' );
		
		// Video player
		videoTitle = getTranslation( 'video.title' );
		videoSize = getTranslation( 'video.size' );
		videoDuration = getTranslation( 'video.duration' );
		videoPlay = getTranslation( 'video.playpause' );
		videoStop = getTranslation( 'video.stop' );
		videoFull = getTranslation( 'video.fullscreen' );
		videoFullErrorTitle = getTranslation( 'video.fullErrorTitle' );
		videoFullErrorMessage = getTranslation( 'video.fullErrorMessage' );
		videoVolume = getTranslation( 'video.volume' ); 
		videoIncrease = getTranslation( 'video.increaseVolume' );
		videoDecrease = getTranslation( 'video.decreaseVolume' );
		videoMute = getTranslation( 'video.muteVolume' );
	}
	
	
	//-------------------------------------------------------------------------
	// Private implementation
	//-------------------------------------------------------------------------
	
	/**
	 * Constructor.
	 */
	private function FvReaderResources()
	{
		super( 'fvaswing:reader' );
	}
	
	private function _initDefault() : Void
	{
		readerTitle = 'Documents reader';
		closeLabel = 'Close';
		popupLabel = 'popup';
		embdedLabel = 'Group with reader';
		maximizeLabel = 'maximize';
		minimizeLabel = 'minimize';
		
		loadingLabel = 'Loading';
		loadingError = 'Loading error';
		
		fileMenuLabel = 'File';
		openFileLabel = 'Open file';
		openListLabel = 'Load list';
		showListLabel = 'Show list';
		saveListLabel = 'Save list';
		saveListLabel = 'Clear list';
		docMenuLabel = 'Document';
		
		listTitle = 'Documents list';
		docFolderLabel = 'documents';
		extFolderLabel = 'external';
		titleLabel = 'Title :';
		urlLabel = 'URL :';
		
		alertTitle = 'Alert';
		alertAlreadyInUse = 'Reader is currently in loading process.';
		alertError = 'Document error.';
		alertError = ' is not a valid playlist.';
		
		//FlashPaper
		paperTitle = 'Documents list';
		paperPage = 'Page(s) :';
		paperPrint = 'Print';
		paperPrevious = 'Previous page';
		paperNext = 'Next page';
		paperFitPage = 'Fit to page';
		paperFitWidth = 'Fit to width';
		paperZoomPlus = 'Zoom+';
		paperZoomMinus = 'Zoom-';
		paperOpenBrowser = 'Open in browser';
		
		// Video player
		videoTitle = 'Videos list';
		videoSize = 'Size :';
		videoDuration = 'Lenght :';
		videoPlay = 'Play / Pause';
		videoStop = 'Stop';
		videoFull = 'Fullscreen mode';
		videoFullErrorTitle = 'Invalid Flash Player version';
		videoFullErrorMessage = 'Current Flash Player version does not allow fullscreen mode.';
		videoVolume = 'Volume'; 
		videoIncrease = 'Increase';
		videoDecrease = 'Decrease';
		videoMute = 'Mute';
	}
}